package edu.lnu.ums.entities;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import edu.lnu.ums.entities.core.UMSObject;
import edu.lnu.ums.entities.dictionaries.Sex;
import edu.lnu.ums.entities.dictionaries.Country;
import edu.lnu.ums.entities.processes.ProfGrowth;

import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Human extends UMSObject {
    private static final long serialVersionUID = 1L;

    @Column
    private String name;
    
    @Column
    private String surname;
    
    @Column
    @Temporal(value=TemporalType.DATE)
    private Date birthDate;
    
    @Column
    private String secondName;
        
    @ManyToOne(cascade={CascadeType.PERSIST})
    @JoinColumn(name="sex")
    private Sex sex;
    
    @ManyToOne
    @JoinColumn(name="state")
    private Country state;

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public String getSecondName() {
        return secondName;
    }

    public void setSecondName(String secondName) {
        this.secondName = secondName;
    }

    public Sex getSex() {
        return sex;
    }

    public void setSex(Sex sex) {
        this.sex = sex;
    }

    public Country getState() {
        return state;
    }

    public void setState(Country state) {
        this.state = state;
    }

    public Class<?> getProfGrowthClass() {
        return ProfGrowth.class;
    }
}
